<template>
        <div class="layui-row" >
            <div class="layui-col-md24">
                <div class="home-tips">
                <lay-notice-bar leftIcon="layui-icon-mute" text="Vue3+TypeScript+layui-vue+前端框架 表单设计+流程引擎前后分离"></lay-notice-bar>
                </div>
            </div>

            <!--左边文章列表-->
            <div class="layui-col-md16">
             <taobao></taobao>
             <blog v-if="appStore.bloglistdata.length>0"  :data="appStore.bloglistdata"></blog>
             <blog v-if="appStore.newsmian.length>0" :data="appStore.newsmian"></blog>


            </div>
            <!--右边小栏目-->
            <div class="layui-col-md8">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-sm24 layui-col-md24">
                        <div class="blogerinfo shadow">
                            <div
                                style="font-family: digital;color: #4cff00; font-size: 40px;text-align: center;   background-color: #000000;">
                                <div style="padding-top: 25px;">{{ show_time }}</div>
                                <div class="date">{{ time }} </div>
                            </div>
                        </div>
                    </div>
               <!-- <applet></applet> -->
                    <div class="layui-col-sm24 layui-col-md24">
                        <div class="blogerinfo shadow">
                            <div class="blogerinfo-figure" style="width:100%">
                                <!-- <img class="layui-nav-img" src="images/0.jpg" alt="爱上歆随懿恫" /> -->
                            </div>
                            <div class="blogerinfo-info" style="    text-align: center;">
                                <p class="blogerinfo-nickname">爱上歆随懿恫</p>

                                <p class="blogerinfo-introduce"
                                    style="margin: 0;  line-height: 3em;  text-align: left;text-indent: 2em;">
                                    <span>成功不是将来才有的，而是从决定去做的那一刻起，持续累积而成。我这个人呢优点挺多的，唯一不足的就是余额不足，我原本可以快乐的生活，都是没钱害了我，所以今年冬天我就决定走复古路线，穿去年的衣服，我不是因为钱，我只是怀旧，我发现我的近视越来越严重了，打开钱包竟然看不到钱，如果有钱也是一种错误,我宁愿一错再错,鱼和熊掌不可兼得,而我的单身和穷却可以,我十几岁就出来工作，从一无所有，发展到身无分文，再从身无分文，发展到负债累累。这就是我，不一样的烟火，我就是我，看到自己都冒火。</span>
                                </p>

                                <p class="blogerinfo-location"><i class="fa fa-location-arrow"></i>&nbsp;云南 - 昭通</p>
                            </div>
                            <div class="blogerinfo-contact">
                                <a target="_blank" title="QQ交流"
                                    href="http://wpa.qq.com/msgrd?v=3&uin=1316227882&site=qq&menu=yes"><i
                                        class="fa fa-qq fa-2x"></i></a>
                                <a target="_blank" title="QQ群"
                                    href="https://qm.qq.com/cgi-bin/qm/qr?k=xPzP8RMtVqfNwutqGDWRdIdwuUV9vvTE&jump_from=webapi&authKey=9mx38UEqa95IIjkbXsuw7seB6ryv5q3Kzbmf57KxKD425CRBILMn6xI+2CxMEM7N"
                                    style="text-decoration:none;"><i class="fa fa-weixin fa-2x"></i></a>
                                <a target="_blank" title="新浪微博"
                                    href="https://m.weibo.cn/u/3902792590?from=1096295010&wm=9006_2001&sourceType=qq&uid=3902792590"><i
                                        class="fa fa-weibo fa-2x"></i></a>
                                <a target="_blank" title="GitHub" href="https://gitee.com/asxsyd92"><i
                                        class="fa fa-github fa-2x"></i></a>
                              <a target="_blank" href="http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=C2p4c3hybzI5S21kc2ZqYmclaGRm" style="text-decoration:none;"><img src="http://rescdn.qqmail.com/zh_CN/htmledition/images/function/qm_open/ico_mailme_12.png"/></a>
                            </div>
                        </div>
                    </div>
                    <randompptVue></randompptVue>

                    <randomnew></randomnew>

                    <music></music>
                       <div class="layui-col-sm12 layui-col-md24 padding0">
                              <div class="blog-card shadow">
                
                           <taobao></taobao>

              
                        </div>
                    </div>
     
                </div>
            </div>
        </div>


</template>

<script lang="ts" setup>
import { ref, reactive } from "vue";
import http from 'webosutils/lib/http';
import blog from '../../components/card/blog.vue';
import taobao from '../../components/card/taobao.vue';
import music from '../../components/card/music.vue';
import applet from '../../components/card/applet.vue';
import randomnew from '../../components/card/randomnew.vue';
import randompptVue from "../../components/card/randomppt.vue";
import { useAppStore } from '../../store/app';
const bloglistdata = ref({title:'',data:[]}) as any;

const appStore = useAppStore();
const newsmian = ref({title:'',data:[]})as any;
const show_time=ref("");
const time=ref("");
const ajax = () => {
    if(appStore.bloglistdata.length==0){
        http.post("/v1/api/portalsite/GetNewIndex", { id: "B496AAC6-B704-4FCE-AD36-CACCEDF3232B" },"请稍等").then(res => {
        console.log(res);
        let p = new Object() as any;
        p.title = "最新博文";
        p.data = res.data;
        bloglistdata.value = Object.freeze( p);
        console.log(bloglistdata.value);
        appStore.bloglistdata=Object.freeze( bloglistdata.value);
    }).catch(res => {

    })

    http.post("/v1/api/portalsite/GetNewIndex", { id: "24244800-AC73-43BC-9E8B-FEA34B296DF3" }).then(res => {
        let p = new Object() as any;
        p.title = "推荐";
        p.data = res.data;
        newsmian.value = Object.freeze( p);
        appStore.newsmian=Object.freeze( newsmian.value);
         console.log(newsmian.value);

    }).catch(res => {


    })

    }else{
        newsmian.value=appStore.newsmian;
        bloglistdata.value  =appStore.bloglistdata;
    }
  

}

    const dateRender = function () {
      try {
        setInterval(function () {
          var da = new Date();
          time.value =
            da.getFullYear() + "-" + (da.getMonth() + 1) + "-" + da.getDate();
          show_time.value =
            da.getHours() +
            ":" +
            da.getMinutes() +
            ":" +
            da.getSeconds() +
            " 星期" +
            "日一二三四五六".charAt(da.getDay());
        }, 100);
      } catch (e) {
        console.log(e);
      }
    };
ajax();
dateRender();
</script>
<style>
</style>
